﻿<%@ Page Title="" Language="C#" MasterPageFile="~/mainMasterPage.master" AutoEventWireup="true" CodeFile="Search.aspx.cs" Inherits="Search" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="mainInfo" Runat="Server">
<% //string country = Request["terms"];
    string terms;
    if (Request["terms"] == null)
    {
        terms = "United States";
    }
    else
    {
        terms = Request["terms"];
    }
   LinkedList<string[]> destinations = searchDestionations(terms);
    %>
			 	<div class="tree"><a href="#">Search</a>  &raquo; <%=terms %></div>
                <% foreach (string[] destination in destinations)
                   {
                       string destid = destination[0];
                       string name = destination[1];
                       string description = destination[2];
                       string image = destination[3];
                       %>
                <h1><%=name%></h1>
				<div class="gallery">
                	<img src="<%=image%>" width="476" height="270" /><br />
                    <% foreach (String term in terms.Split(' '))
                       {
                           description = Regex.Replace(description, term, "<b><font color=\"red\">" + term + "</font></b>", RegexOptions.IgnoreCase);
                       } %>
                    <p><%=description%></p>
				    <a href="inquiry.aspx?id=<%=destid%>" class="button">book it!</a>
                    <p></p>
				</div>
                <hr />
                <% } %>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="rightSideInfo" Runat="Server">
</asp:Content>

